package com.atguigu.chapter05.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/7/16 11:28
 */
public class Flink01_Source_File {
    public static void main(String[] args) throws Exception {
        // file socket
    
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);
        DataStreamSource<String> source = env.readTextFile("hdfs://hadoop162:8020/words.txt");
        source.print();
    
        env.execute();
    
    }

}
